package dp;

import java.util.HashMap;
import java.util.Map;

public class Invoqueur {
	
	private Map<String, Command> commandes = new HashMap<String, Command>();

	public void addCommande(String ref, Command command) {
		commandes.put(ref, command);
	}
	
	public void invoquer(String ref) {
		Command cmd = commandes.get(ref);
		if (cmd != null) {
			cmd.executer();
		}
	}
}
